package com.inst.rocketmq.controller;


import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController("/mq")
public class ProducerController {

    @Autowired
    private RocketMQTemplate rocketMQTemplate;


    @RequestMapping("/send")
    public void send() {

        String json = "普通消息";
        rocketMQTemplate.convertAndSend("send_msg_topic", json);

    }
}
